package com.seafwg.dao.impl;

import com.seafwg.dao.UserDao;
import com.seafwg.domain.User;

import java.util.List;
import java.util.Map;
import java.util.Properties;

/**
 * @Author seafwg
 * @Date 2022/1/23 6:36 下午
 * @Version 1.0
 * @description xxx
 */

public class UserDaoImp implements UserDao {
    // 1.基本数据类型的注入
    private String name;
    private int age;
    private String addr;

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }
    // 2.集合类型注入
    private List<String> stringList;

    public void setStringList(List<String> stringList) {
        this.stringList = stringList;
    }
    // 3.Map集合的注入
    private Map<String, User> UserMap;

    public void setUserMap(Map<String, User> userMap) {
        UserMap = userMap;
    }
    // 4.property属性注入
    private Properties properties;

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    @Override
    public void save() {
        System.out.println("UserDao run ...");
        System.out.println("基本属性注入..."+this.name+this.age+this.addr);
        System.out.println("UserDao..."+this.stringList);
        System.out.println("=============================");
        System.out.println(this.UserMap);
        System.out.println(this.properties);
    }
}
